-- Decompiled with the Synapse X Luau decompiler.

local l__ServerOHOH__1 = _G.ServerOHOH;
local v2 = l__ServerOHOH__1.class.new(script);
function v2.AddQueue(p1, p2)
	assert(p2, "function is nil");
	if p1.stack_num < 500 and p1.clock_num < 60 then
		table.insert(p1.stack, p2);
		return;
	end;
	table.insert(p1.pool, p2);
end;
local u1 = l__ServerOHOH__1.load.GameDataConfig();
local l__HttpService__2 = game:GetService("HttpService");
function v2.HttpPost(p3, p4, p5)
	if not u1.Switch then
		return nil;
	end;
	local u3 = nil;
	local v3, v4 = pcall(function()
		u3 = l__HttpService__2:RequestAsync({
			Url = p5, 
			Method = "POST", 
			Body = p4
		});
	end);
	return v3, v4;
end;
local l__coroutine__4 = coroutine;
function v2.FireHttp(p6, p7)
	assert(p7, "fire_fun is nil");
	local v5, v6 = p6:HttpPost(p7[1], p7[2]);
	if not v5 then
		l__coroutine__4.resume((l__coroutine__4.create(function()
			if not p6:HTTPExceptionHand(p7) then
				warn("Http \229\143\145\233\128\129\229\164\177\232\180\165\239\188\129");
			end;
		end)));
	end;
end;
local l__wait__5 = wait;
function v2.HTTPExceptionHand(p8, p9)
	local v7 = 0;
	while true do
		if v7 > 10 then
			return false;
		end;
		local v8, v9 = p8:HttpPost(p9[1], p9[2]);
		if v8 then
			break;
		end;
		v7 = v7 + 1;
		l__wait__5(3);	
	end;
	return true;
end;
function v2.Start(p10)
	p10.stack_num = 0;
	p10.clock_num = 60;
	p10.stack = {};
	p10.pool = {};
	l__coroutine__4.resume((l__coroutine__4.create(function()
		local v10, v11 = xpcall(function()
			local v12 = os.clock();
			while true do
				if p10.stack_num < 500 and p10.stack_num < #p10.stack then
					for v13 = p10.stack_num + 1, #p10.stack do
						p10:FireHttp(p10.stack[v13]);
						p10.stack_num = v13;
						if p10.stack_num >= 500 then
							break;
						end;
					end;
				end;
				p10.clock_num = os.clock() - v12;
				if p10.clock_num > 60 then
					v12 = os.clock();
					p10.stack_num = 0;
					p10.stack = {};
					p10:UpdataStack();
				end;
				l__wait__5();			
			end;
		end, debug.traceback);
		if not v10 then
			warn(v11);
		end;
	end)));
end;
function v2.UpdataStack(p11)
	if p11.pool and #p11.pool > 0 then
		for v14 = math.min(#p11.pool, 499), 1, -1 do
			table.insert(p11.stack, p11.pool[v14]);
			table.remove(p11.pool, v14);
		end;
	end;
end;
v2:Start();
return v2;
